Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stringify less when processing recordindgs #20943

Merged
merged 2 commits into from
Mar 15, 2024
Merged

Conversation

pauldambra
Copy link
Member

Went poking around looking for what might be causing the reported problems where replay eventually becomes laggy

Nothing significant discovered yet but when looking at the profiles of the page deduplicateSnapshots was drowning out other function calls.

We call deduplicateSnapshots many times and merge existing snapshots with any new ones, then stringify each so that we can identify and remove duplicates

We can store the calculated key so that we only do the potentially expensive calculation once per item

We could move the hash into the logic's cache so that we don't need to reprocess existing items - but that's not a last thing in the day fix

This is a quick patch to process items less. After which deduplicateSnapshots doesn't show as a significant function call in page profiles

@pauldambra pauldambra requested a review from a team March 14, 2024 23:58
Copy link
Contributor

github-actions bot commented Mar 15, 2024

Size Change: 0 B

Total Size: 822 kB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 822 kB

compressed-size-action

@pauldambra pauldambra merged commit 800fddb into master Mar 15, 2024
80 checks passed
@pauldambra pauldambra deleted the fix/stringify-less branch March 15, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants